<% layout('/layouts/default.html', {title: '企业微信公众号维护管理管理', libs: ['dataGrid']}){ %>
<div class="main-content">
	<div class="box box-main">
		<div class="box-header">
			<div class="box-title">
				<i class="fa fa-list-alt"></i> ${text('企业微信公众号维护管理管理')}
			</div>
			<div class="box-tools pull-right">
				<a href="#" class="btn btn-default" id="btnSearch" title="${text('查询')}"><i class="fa fa-filter"></i> ${text('查询')}</a>
				<% if(hasPermi('qywx:qiyePush:edit')){ %>
					<a href="${ctx}/qywx/qiyePush/form" class="btn btn-default btnTool" title="${text('新增企业微信公众号维护管理')}"><i class="fa fa-plus"></i> ${text('新增')}</a>
				<% } %>
			</div>
		</div>
		<div class="box-body">
			<#form:form id="searchForm" model="${qiyePush}" action="${ctx}/qywx/qiyePush/listData" method="post" class="form-inline hide"
					data-page-no="${parameter.pageNo}" data-page-size="${parameter.pageSize}" data-order-by="${parameter.orderBy}">
				<div class="form-group">
					<label class="control-label">${text('排序号')}：</label>
					<div class="control-inline">
						<#form:input path="wxSort" maxlength="11" class="form-control width-120"/>
					</div>
				</div>
				<div class="form-group">
					<label class="control-label">${text('父表主键')}：</label>
					<div class="control-inline">
						<#form:input path="wxDataId" maxlength="64" class="form-control width-120"/>
					</div>
				</div>
				<div class="form-group">
					<label class="control-label">${text('单行文本')}：</label>
					<div class="control-inline">
						<#form:input path="wxInput" maxlength="200" class="form-control width-120"/>
					</div>
				</div>
				<div class="form-group">
					<label class="control-label">${text('多行文本')}：</label>
					<div class="control-inline">
						<#form:input path="wxTextarea" maxlength="200" class="form-control width-120"/>
					</div>
				</div>
				<div class="form-group">
					<label class="control-label">${text('下拉框')}：</label>
					<div class="control-inline">
						<#form:input path="wxSelect" maxlength="10" class="form-control width-120"/>
					</div>
				</div>
				<div class="form-group">
					<label class="control-label">${text('下拉多选')}：</label>
					<div class="control-inline">
						<#form:input path="wxSelectMultiple" maxlength="200" class="form-control width-120"/>
					</div>
				</div>
				<div class="form-group">
					<label class="control-label">${text('单选框')}：</label>
					<div class="control-inline">
						<#form:input path="wxRadio" maxlength="10" class="form-control width-120"/>
					</div>
				</div>
				<div class="form-group">
					<label class="control-label">${text('复选框')}：</label>
					<div class="control-inline">
						<#form:input path="wxCheckbox" maxlength="200" class="form-control width-120"/>
					</div>
				</div>
				<div class="form-group">
					<label class="control-label">${text('日期选择')}：</label>
					<div class="control-inline">
						<#form:input path="wxDate" readonly="true" maxlength="20" class="form-control Wdate-datetime"
							dataFormat="datetime" onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm',isShowClear:false});"/>
					</div>
				</div>
				<div class="form-group">
					<label class="control-label">${text('日期时间')}：</label>
					<div class="control-inline">
						<#form:input path="wxDatetime" readonly="true" maxlength="20" class="form-control Wdate-datetime"
							dataFormat="datetime" onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm',isShowClear:false});"/>
					</div>
				</div>
				<div class="form-group">
					<label class="control-label">${text('用户选择')}：</label>
					<div class="control-inline">
						<#form:input path="wxUserCode" maxlength="64" class="form-control width-120"/>
					</div>
				</div>
				<div class="form-group">
					<label class="control-label">${text('机构选择')}：</label>
					<div class="control-inline">
						<#form:input path="wxOfficeCode" maxlength="64" class="form-control width-120"/>
					</div>
				</div>
				<div class="form-group">
					<label class="control-label">${text('区域选择')}：</label>
					<div class="control-inline">
						<#form:input path="wxAreaCode" maxlength="64" class="form-control width-120"/>
					</div>
				</div>
				<div class="form-group">
					<label class="control-label">${text('区域名称')}：</label>
					<div class="control-inline">
						<#form:input path="wxAreaName" maxlength="100" class="form-control width-120"/>
					</div>
				</div>
				<div class="form-group">
					<label class="control-label">${text('微信号ID')}：</label>
					<div class="control-inline">
						<#form:input path="wxCorpid" maxlength="64" class="form-control width-120"/>
					</div>
				</div>
				<div class="form-group">
					<label class="control-label">${text('微信名称')}：</label>
					<div class="control-inline">
						<#form:input path="wxUserid" maxlength="64" class="form-control width-120"/>
					</div>
				</div>
				<div class="form-group">
					<label class="control-label">${text('SessionKey')}：</label>
					<div class="control-inline">
						<#form:input path="wxSessionKey" maxlength="255" class="form-control width-120"/>
					</div>
				</div>
				<div class="form-group">
					<label class="control-label">${text('昵称_显示名称')}：</label>
					<div class="control-inline">
						<#form:input path="wxNikeName" maxlength="64" class="form-control width-120"/>
					</div>
				</div>
				<div class="form-group">
					<label class="control-label">${text('秘钥')}：</label>
					<div class="control-inline">
						<#form:input path="wxGrantType" maxlength="255" class="form-control width-120"/>
					</div>
				</div>
				<div class="form-group">
					<button type="submit" class="btn btn-primary btn-sm">${text('查询')}</button>
					<button type="reset" class="btn btn-default btn-sm">${text('重置')}</button>
				</div>
			</#form:form>
			<table id="dataGrid"></table>
			<div id="dataGridPage"></div>
		</div>
	</div>
</div>
<% } %>
<script>
// 初始化DataGrid对象
$('#dataGrid').dataGrid({
	searchForm: $("#searchForm"),
	columnModel: [
		{header:'${text("排序号")}', name:'wxSort', index:'a.wx_sort', width:150, align:"left", frozen:true, formatter: function(val, obj, row, act){
			return '<a href="${ctx}/qywx/qiyePush/form?id='+row.id+'" class="btnList" data-title="${text("编辑企业微信公众号维护管理")}">'+(val||row.id)+'</a>';
		}},
		{header:'${text("父表主键")}', name:'wxDataId', index:'a.wx_data_id', width:150, align:"left"},
		{header:'${text("单行文本")}', name:'wxInput', index:'a.wx_input', width:150, align:"left"},
		{header:'${text("多行文本")}', name:'wxTextarea', index:'a.wx_textarea', width:150, align:"left"},
		{header:'${text("下拉框")}', name:'wxSelect', index:'a.wx_select', width:150, align:"left"},
		{header:'${text("下拉多选")}', name:'wxSelectMultiple', index:'a.wx_select_multiple', width:150, align:"left"},
		{header:'${text("单选框")}', name:'wxRadio', index:'a.wx_radio', width:150, align:"left"},
		{header:'${text("复选框")}', name:'wxCheckbox', index:'a.wx_checkbox', width:150, align:"left"},
		{header:'${text("日期选择")}', name:'wxDate', index:'a.wx_date', width:150, align:"center"},
		{header:'${text("日期时间")}', name:'wxDatetime', index:'a.wx_datetime', width:150, align:"center"},
		{header:'${text("用户选择")}', name:'wxUserCode', index:'a.wx_user_code', width:150, align:"left"},
		{header:'${text("机构选择")}', name:'wxOfficeCode', index:'a.wx_office_code', width:150, align:"left"},
		{header:'${text("区域选择")}', name:'wxAreaCode', index:'a.wx_area_code', width:150, align:"left"},
		{header:'${text("区域名称")}', name:'wxAreaName', index:'a.wx_area_name', width:150, align:"left"},
		{header:'${text("微信号ID")}', name:'wxCorpid', index:'a.wx_corpid', width:150, align:"left"},
		{header:'${text("微信名称")}', name:'wxUserid', index:'a.wx_userid', width:150, align:"left"},
		{header:'${text("SessionKey")}', name:'wxSessionKey', index:'a.wx_session_key', width:150, align:"left"},
		{header:'${text("昵称_显示名称")}', name:'wxNikeName', index:'a.wx_nike_name', width:150, align:"left"},
		{header:'${text("秘钥")}', name:'wxGrantType', index:'a.wx_grant_type', width:150, align:"left"},
		{header:'${text("操作")}', name:'actions', width:120, sortable:false, title:false, formatter: function(val, obj, row, act){
			var actions = [];
			<% if(hasPermi('qywx:qiyePush:edit')){ %>
				actions.push('<a href="${ctx}/qywx/qiyePush/form?id='+row.id+'" class="btnList" title="${text("编辑企业微信公众号维护管理")}"><i class="fa fa-pencil"></i></a>&nbsp;');
				if (row.status == Global.STATUS_NORMAL){
					actions.push('<a href="${ctx}/qywx/qiyePush/disable?id='+row.id+'" class="btnList" title="${text("停用企业微信公众号维护管理")}" data-confirm="${text("确认要停用该企业微信公众号维护管理吗？")}"><i class="glyphicon glyphicon-ban-circle"></i></a>&nbsp;');
				}
				if (row.status == Global.STATUS_DISABLE){
					actions.push('<a href="${ctx}/qywx/qiyePush/enable?id='+row.id+'" class="btnList" title="${text("启用企业微信公众号维护管理")}" data-confirm="${text("确认要启用该企业微信公众号维护管理吗？")}"><i class="glyphicon glyphicon-ok-circle"></i></a>&nbsp;');
				}
				actions.push('<a href="${ctx}/qywx/qiyePush/delete?id='+row.id+'" class="btnList" title="${text("删除企业微信公众号维护管理")}" data-confirm="${text("确认要删除该企业微信公众号维护管理吗？")}"><i class="fa fa-trash-o"></i></a>&nbsp;');
			<% } %>
			return actions.join('');
		}}
	],
	// 加载成功后执行事件
	ajaxSuccess: function(data){
		
	}
});
</script>